package api

import (
	"fmt"
	"github.com/julienschmidt/httprouter"
	"log"
	"models"
	"net/http"
	"utils"
)

func UserLogin(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
	for k, v := range r.Form {
		fmt.Println("key is: ", k)
		fmt.Println("val is: ", v)
	}
	ss := GetSession(w, r, params)
	if ss.Id == "" {
		fmt.Fprintln(w, models.ServerError)
		return
	}
	var forms = utils.FormatPost(r)
	var password = forms["password"]
	var username = forms["user_name"]
	var user = models.SelectUser(username)
	log.Println(user, password)
}
